<?php

/**
 * @author TUNAFISHIE
 */
class floorplans_model extends CI_Model {

    var $openingHours = array();

    function __construct() {
        parent::__construct();
    }
	  function parseFloorplansXml($xmlfloorplansUrl,$index) {
	   
	   $Floorplansone = array();
	   $Floorplans = "";
       $locationCount = "";
	   $location="";
	   $image ='';
       $coords = '';
	   $locationName='';
	   $FloorplansOneData = simplexml_load_file($xmlfloorplansUrl);
       $FloorplansInfoList = array();
		$floorplan = $FloorplansOneData->homes->floorplan[$index];
	
		 $locationCount = count($floorplan->location);
		  for ($i = 0; $i < $locationCount; $i++) {
		   $location = $floorplan->location[$i];

            //get start date of the term
			$locationName = (string)$location->locationName;
            $image = (string) $location->image;
			 $coords = (string) $location->coords;
			   $Floorplansone[] = array('locationName' => $locationName,'image' => $image, 'coords' => $coords);
		  }
		

        $FloorplansInfoList = array('FloorplansInfo' => $Floorplansone);
        return $FloorplansInfoList;
    }
}
?>